package com.jade.journal;

import com.jade.framework.base.pattern.pipeline.Valve;
import com.jade.framework.base.pattern.pipeline.ValveChain;

/**
 * 抽象的日志处理阀门。
 *
 * @author Daisy
 * @version 1.0 14-9-21 下午10:30
 */
public abstract class JournalValve extends Valve<JournalEvent[], Exception>
{
    @Override
    public void handle(JournalEvent[] journalEvent, ValveChain<JournalEvent[], Exception> chain)
            throws Exception
    {
        doHandle(journalEvent);
        chain.handleNext(journalEvent);
    }

    protected abstract void doHandle(JournalEvent[] events);
}
